home *** CD-ROM | disk | FTP | other *** search
/ Robotics & Artificial Int…3 (Professional Edition) / Robotics & Artificial Intelligence Tools 2003 (Professional Edition).iso / neural network tool and application / nsinstall.exe / data1.cab / DllSys_Files / OUTPUT / OUTPUT.C
Encoding:
C/C++ Source or Header  |  2002-03-08  |  1.1 KB  |  42 lines

  1. // Dynamic link library implementation of a generic output source
  2.  
  3. #include "NSDLL.h" 
  4.  
  5. #define data(i,j)        data[j+i*cols]
  6.  
  7. /***************************/
  8. /* Activation of component */
  9. __declspec(dllexport) BOOL performOutput(
  10.     DLLData    *instance,    // Pointer to instance data (may be NULL)
  11.     NSFloat    *data,         // Pointer to the data
  12.     int rows,         // Number of rows of data
  13.     int cols         // Number of cols of data
  14.     )
  15. {
  16.     int i,j;
  17.     NSFloat myOutput;
  18.  
  19.     for (i=0; i<rows; i++)
  20.         for (j=0; j<cols; j++)
  21.             myOutput = data(i,j);    // You define your own output source.
  22.     return TRUE;    // Return wether or not the output component should still work
  23. }
  24.  
  25. /******************************************/
  26. /* Management of instance data (OPTIONAL) */
  27. /*
  28. __declspec(dllexport) DLLData *allocOutput(
  29.     DLLData    *oldInstance,    // Pointer to the last instance if reallocating
  30.     int rows,         // Number of rows of data
  31.     int cols         // Number of cols of data
  32.     )
  33. {
  34.     DLLData *instance = allocDLLInstance(oldInstance);
  35.     return instance;
  36. }
  37.  
  38. __declspec(dllexport) void freeOutput(DLLData *instance)
  39. {
  40.     freeDLLInstance(instance); 
  41. }
  42. */